package Game;/**
 * @ProjectName: shadow
 * @Package: Game
 * @ClassName: Buff
 * @Author: 张晟睿
 * @Date: 2021/9/8 17:20
 * @Version: 1.0
 */

import java.awt.*;
import java.util.Random;

/**
 *@ClassName Buff
 *@Description
 *@Author 张晟睿
 *@Date 2021/9/8
 **/
public class Buff {
    private String name;
    int x,y,w,h;
    int step = 0;
    boolean BuffFlag = false;//判断BUff是否碰撞 如果碰撞就为false消失

    public Buff(){}


    public Buff(int buffx , int buffy){
//        x = new Random().nextInt(1000);
//        y = new Random().nextInt(600);
        x=buffx;
        y=buffy;
        w = h = 30;
    }

    public void AddBuff(Graphics g) {//画出加速块
        if(BuffFlag){
            Color c = g.getColor();
            g.setColor(Color.MAGENTA);
            g.fillRect(x, y, w, h);
            g.setColor(c);
        }

    }

    //碰撞检测
    public Rectangle getRect(){
        return new Rectangle(x,y,w,h);
    }

}